/**
 * Copyright (C) 2013 SHANGHAI VOLKSWAGEN, All rights reserved.
 * License version 1.0, a copy of which has been included with this.
 *
 * @File name：com.market.cart.server.controller.AddrController
 * @Create on：2024/3/9
 * @Author：liuchang
 */
package com.market.cart.server.controller;

import com.market.cart.common.domain.DeliveryAddress;
import com.market.cart.server.service.AddrService;
import com.market.common.core.domain.Result;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.*;

/**
 * <p>ClassName：AddrController</p >
 * <p>Description：</p >
 * <p>Author：liuchang</p >
 * <p>Date：2024/3/9</p >
 */
@RestController
@RequestMapping("/addr")
public class AddrController {
    @Autowired
    private AddrService addrService;

    /**
     * <p></p >
     * @author：liuchang
     * @date：2024/3/9
     * @param：
     * @return：
    */
    @GetMapping("/findAllAddress")
    public Result findAllAddress() {
        return addrService.findAllAddress();
    }
    /*
    * 新增收货地址
    * */
    @PostMapping("/addAddress")
    public Result addAddress(@RequestBody @Validated DeliveryAddress deliveryAddress){
        return addrService.addAddress(deliveryAddress);
    }
    @PostMapping("/findAddrByUserId")
    public Result findAddrByUserId(){
        return addrService.findAddrByUserId();
    }
}
